package com.chinamobile.websocket.websocketdispatcher.config.serializer;

import com.chinamobile.websocket.domain.bo.WebsocketKafkaMessageBo;
import com.chinamobile.websocket.util.JsonUtil;
import org.apache.kafka.common.serialization.Serializer;

import java.util.Map;

public class KafkaMessageSerializer implements Serializer<WebsocketKafkaMessageBo> {
    @Override
    public void configure(Map<String, ?> configs, boolean isKey) {

    }

    @Override
    public byte[] serialize(String topic, WebsocketKafkaMessageBo data) {
        return JsonUtil.convertObject2Bytes(data);
    }

    @Override
    public void close() {

    }
}
